import { PageReq, PageRes } from '@/api/types'
import request from '@/utils/request'
import { EasterModel } from '@/api/model/easter-model'

// 获取复活列表
export function easterPageApi(data: PageReq<Partial<any>>) {
  return request<PageRes<any>>({
    url: '/easter/page',
    method: 'post',
    data
  })
}

// 新增复活
export function addEasterApi(data: Partial<EasterModel>) {
  return request({
    url: '/easter/add',
    method: 'post',
    data
  })
}

// 更新复活
export function editEasterApi(data: Partial<EasterModel & { id: number }>) {
  return request({
    url: '/easter/edit',
    method: 'post',
    data
  })
}

// 删除复活
export function delEasterApi(data: { id: number }) {
  return request({
    url: '/easter/del',
    method: 'post',
    data
  })
}

// 获取复活列表
export function getEasterListApi(data: { isInStore: boolean }) {
  return request({
    url: '/easter/getEasterList',
    method: 'post',
    data
  })
}

// 获取复活详情
export function getEasterDetailApi(data: { id: number }) {
  return request({
    url: '/easter/getEasterDetail',
    method: 'post',
    data
  })
}
